package org.domon.manager.base.service;

import org.domon.manager.base.mybatis.MyBatisPojo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class BaseService<M, P extends MyBatisPojo> {

	protected static Logger logger;

	public BaseService() {
		logger = LoggerFactory.getLogger(getClass().getName());
	}

	/**
	 * 数据库POJO转页面Model
	 * 
	 * @param pojo
	 * @return
	 */
	protected abstract M pojoToModel(P pojo);

	/**
	 * 页面Model转数据库POJO
	 * 
	 * @param model
	 * @return
	 */
	protected abstract P modelToPojo(M model);
}
